# general purpose utility functions for the shared objects

def safeFn(fn):
    """ get a valid file name out of a string """
    rv = [ ]
    for ch in fn:
        if ch in '\\/;':
            ch = '-'
        elif ch.isspace():
            ch = '_'
        elif ch in '{[()]}"\'?`*=+':
            continue
        rv.append(ch)
    return "".join(rv)

